package com.frogs.ucenter.dao.ibatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Repository;

import com.frogs.framework.base.dao.ibatis.BaseDaoIbatis;
import com.frogs.ucenter.dao.TagUserRelationDao;
import com.frogs.ucenter.entity.TagUserRelation;
import com.ibatis.sqlmap.client.SqlMapClient;

@Repository("tagUserRelationDao")
public class TagUserRelationDaoImpl extends BaseDaoIbatis<TagUserRelation> implements TagUserRelationDao {

	public TagUserRelationDaoImpl() {
		super();
		setNameSpace("tag_user_relation");
	}

	@Required
	@Autowired
	public void setSqlMapClientAutowired(SqlMapClient sqlMapClient) {
		super.setSqlMapClient(sqlMapClient);
	}

	@Override
	public List<Map<String, Object>> listUserTags(Map<String, Object> params) {
		try {
			return getSqlMapClient().queryForList(getNameSpace() + ".selectTagsByUserId", params);
		} catch (Exception e) {
			return null;
		}
	}
}